const express = require("express");
const expressJoi = require("../utils/express-joi");
const areaController = require("../controllers/areaController");
const router = express.Router();

const {
  reg_area_add_schema,
  reg_area_edit_schema,
  reg_area_delete_schema,
} = require("../schemas/areaSchema");

// 获取树结构
router.get("/tree", (req, res) => {});

// 添加区域 ,
router.post("/add", expressJoi(reg_area_add_schema), areaController.addArea);

// 删除区域
router.delete(
  "/delete/:id",
  expressJoi(reg_area_delete_schema),
  areaController.deleteArea
);
// 修改区域
router.post("/edit", expressJoi(reg_area_edit_schema), areaController.editArea);

module.exports = router;
